var reportstr="<div id='report_div'>举报他:"+"<input type='text' name='beReportName' id='beReportName' readonly='readonly'/><br/>"+
	"举报情况:<textarea rows='10' cols='20' name='reportContent' id='reportContent'></textarea><br/></div>";
var privatetalkstr="<div id='privatemessage'>"+ "发给：<input type='text' name='toName' id='toName' readonly='readonly'/><br/>"+
	"内容：<textarea rows='10' cols='20' name='messagContent' id='messagContent'></textarea><br/>"+ "</div>"+
"<div id='privatefiles'>"+"<div style='padding-left: 5px;'>"+ "<span id='spanButtonPlaceholder3'></span>"+
"<input id='btnCancel3' type='button' value='Cancel Uploads' onclick='cancelQueue(upload3)' disabled='disabled' style='margin-left: 2px; height: 22px; font-size: 8pt;' />"+
 "<br />"+"</div>"+ "<div class='fieldset flash' id='fsUploadProgress3' style='float: center;'>"+ "<span class='legend'>文件上传</span>"+"</div>"+"</div>";    

var customuploadfilestr="<div id='customuploadfilestrdiv'>"+
							"<span id='spanButtonPlaceholder4'></span>"+
							"<input id='btnCancel4' type='button' value='Cancel Uploads' onclick='cancelQueue(upload4)' disabled='disabled' style='margin-left: 2px; height: 22px; font-size: 8pt;' />"+
							"<div class='fieldset flash' id='fsUploadProgress4' style='float: center;'>"+
								"<span class='legend'>文件上传</span>"+
							"</div>"+
						"</div>";





var upload3;
var upload4;
function sendswf3(){
	 upload3.startUpload();
}
function sendswf4(){
	
	upload4.startUpload();
}
function initSWFUpload3(){
	 upload3 = new SWFUpload({
			//提交路径
			upload_url: "PrivateTalkSWFUploadAction",
			//向后台传递额外的参数
			 post_params: {"toName" :$("#toName").val()},
			//上传文件的名称
			file_post_name: "file",
			
			// 下面自己按照字面意思理解
			file_size_limit : "102400",	// 100MB
			file_types : "*.txt;*.gif",
			file_types_description : "txt模式和JPG",
			file_upload_limit : "10",
			file_queue_limit : "0",

			// 事件处理
			file_dialog_start_handler : fileDialogStart3,
			file_queued_handler : fileQueued3,
			file_queue_error_handler : fileQueueError3,
			file_dialog_complete_handler : fileDialogComplete3,
			upload_start_handler : uploadStart3,
			upload_progress_handler : uploadProgress3,
			upload_error_handler : uploadError3,
			upload_success_handler : uploadSuccess3,
		    upload_complete_handler : uploadComplete3,

			// 按钮的处理
			button_image_url : "swfupload/XPButtonUploadText_61x22.png",
			button_placeholder_id : "spanButtonPlaceholder3",
			button_width: 61,
			button_height: 22,
			
			// Flash Settings
			flash_url : "swfupload/swfupload.swf",
			custom_settings : {
				progressTarget : "fsUploadProgress3",
				cancelButtonId : "btnCancel3"
			},
			// Debug Settings
			debug: false
		});
	
}
function ShowMoreComment(Customid){
	alert(Customid);
	window.open("ShareInfo?_id="+Customid);
}
function initSWFUpload4(customId,toName){
	upload4= new SWFUpload({
			//提交路径
			upload_url: "CustomUploadFileAction",
			//向后台传递额外的参数
			 post_params: {"customId":customId,"toName":toName},
			//上传文件的名称
			file_post_name: "files",
			
			// 下面自己按照字面意思理解
			file_size_limit : "102400",	// 100MB
			file_types : "*.txt;*.gif",
			file_types_description : "txt模式和JPG",
			file_upload_limit : "10",
			file_queue_limit : "0",

			// 事件处理
			file_dialog_start_handler : fileDialogStart,
			file_queued_handler : fileQueued,
			file_queue_error_handler : fileQueueError,
			file_dialog_complete_handler : fileDialogComplete,
			upload_start_handler : uploadStart,
			upload_progress_handler : uploadProgress,
			upload_error_handler : uploadError,
			upload_success_handler : uploadSuccess,
		    upload_complete_handler : uploadComplete,

			// 按钮的处理
			button_image_url : "swfupload/XPButtonUploadText_61x22.png",
			button_placeholder_id : "spanButtonPlaceholder4",
			button_width: 61,
			button_height: 22,
			
			// Flash Settings
			flash_url : "swfupload/swfupload.swf",
			custom_settings : {
				progressTarget : "fsUploadProgress4",
				cancelButtonId : "btnCancel4"
			},
			debug: false
		});
	
}
	function getTop(height)
  	{
		var windowheight=window.innerHeight;
		return (windowheight-height)/2;
	}
	function getLeft(width)
	{
		var windowwidth=window.innerWidth;
		return (windowwidth-width)/2;
	}
	function showAllprivatetalk(id)
	{
		$("#"+id).slideDown(1000);
	}
	function hideAllprivatetalk(id)
	{
		$("#"+id).slideUp(1000);
	}
	function DoJpages(){
	$("div.holder2").jPages({
	    containerID :"osc",
		first: '首页',
		last: '尾页',
		previous: '上页',
		next: '下页',
	    perPage:6,
		/*animation: 'wobble',*/
		callback: function( pages, items ){
			items.showing.find("img").trigger("turnPage");
			items.oncoming.find("img").trigger("turnPage");
		}
	});
}
	function DoMyShareJpages(){
		$("div.holder3").jPages({
		    containerID :"all_share_content_myshare",
			first: '首页',
			last: '尾页',
			previous: '上页',
			next: '下页',
		    perPage:2,
			/*animation: 'wobble',*/
			callback: function( pages, items ){
				items.showing.find("img").trigger("turnPage");
				items.oncoming.find("img").trigger("turnPage");
			}
		});
	}
	function DoPartInShareJpages(){
		$("div.holder").jPages({
		    containerID :"all_share_content_myparticipation",
			first: '首页',
			last: '尾页',
			previous: '上页',
			next: '下页',
		    perPage:2,
			/*animation: 'wobble',*/
			callback: function( pages, items ){
				items.showing.find("img").trigger("turnPage");
				items.oncoming.find("img").trigger("turnPage");
			}
		});
	}
	function DoPrivateJpages(){
		$("div.holder4").jPages({
		    containerID :"alleachtalk",
			first: '首页',
			last: '尾页',
			previous: '上页',
			next: '下页',
		    perPage:1,
			/*animation: 'wobble',*/
			callback: function( pages, items ){
				items.showing.find("img").trigger("turnPage");
				items.oncoming.find("img").trigger("turnPage");
			}
		});}
	function slidedown(id){
		$("#"+id).slideDown(1000);
	}
	
	function toButton(){
		$("button").button();
	}
		function myChestAll(){
			document.getElementById("allofmyshareid").className="myfriend_friendactivity_content_right_select_myshare";
			$("#moneyall").addClass('myfriend_friendactivity_content_right_select_mymoney2');
			$("#friendall").addClass('myfriend_friendactivity_content_right_select_myfriend2');
			$("#friend_content_right").html("");
			$("#friend_content_right").html("<span style='float: left' class=''><a href='javascript:void(0)' onclick='share()'> <font  id='sharefont'>分享收入</font></a>(<span id='sharemoney'></span>元)</span>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<span style='float: right;'><a href='javascript:void(0);' onclick='cost()'><font id='costfont'>消费支出</font></a>（<span id='costmoney'></span>元）</span><br><br>");
			$("#friend_content_right").append("<div id='shareall'>"+"</div>");
			$("#friend_content_right").append("<div id='costall' style='display:none;'></div>");
			$("#shareall").html("<div style='background-color:#FAFAD2;'><span style='float:left'>分享主题 </span><span style='float:center'>分享金额 </span><span style='float:right'>获得时间 </span></div>");
			$("#costall").html("<div style='background-color:#FAFAD2;'><span style='float:left'>消费主题 </span><span style='float:center'>消费金额 </span><span style='float:right'>消费时间 </span></div>");
			$("#sharefont").css("color","red");
			$.getJSON('ChestAction!twoListfind.action',function(data){
					for(var i=0;i<data.commission.length;i++){
		      			$("#shareall").append("<div style='height:50px; background-color:#cccccc;'><span style='float:left;'>"+"<img src="+data.commission[i].customPic+" width='40px' height='50px' padding-top: 0px;/></span>"+"<span style='float:center'>"+data.commission[i].getMoney +"</span><span style='float:right'>"+data.commission[i].commissionTime+"</span></div>");
					}
					$("#sharemoney").html(data.commissionAllMoney);
					for(var j=0;j<data.custom.length;j++){
						$("#costall").append("<div style='height:50px;  background-color:#cccccc;'><span style='float:left;'>"+"<img src="+data.custom[j].customPic+" width='40px' height='50px' padding-top: 0px;/></span>"+"<span style='float:center'>"+data.custom[j].customPrice+"</span><span style='float:right'>"+data.custom[j].customTime+"</span></div>");
					}
					$("#costmoney").html(data.customAllMoney);
			});
		}
		function myFriendsAll(){
			
			document.getElementById("moneyall").className="myfriend_friendactivity_content_right_select_mymoney";
			document.getElementById("friendall").className="myfriend_friendactivity_content_right_select_myfriend";
			document.getElementById("allofmyshareid").className="myfriend_friendactivity_content_right_select_myshare";
			// at id=friend_content_right's div add the friend and privatecenter label
			/*-------------------------------THE TOP CONTENT BEGIN-----------------------------------*/
			$("#friend_content_right").html("");//clean all the friend_content_right content
			$("#friend_content_right").append("<div class='myfriend_friendactivity_content_right_childtitle' id='refer30'></div>");
			$(".myfriend_friendactivity_content_right_childtitle").append("<div class='myfriend_friendactivity_content_right_childtitle_left'></div>");
			$(".myfriend_friendactivity_content_right_childtitle_left").append("<div style='width:153px; height:23px; float:left; padding-top:3px; text-align:left;'><a href='javascript:void(0);' onclick='showfriendschange()'>好友动态</a>(<span id='osccount'></span>条)</div>");
			
			$(".myfriend_friendactivity_content_right_childtitle").append("<div class='myfriend_friendactivity_content_right_childtitle_right'></div>");
			$(".myfriend_friendactivity_content_right_childtitle_right").append("<div style='width:153px; height:23px; padding-top:3px;'><a href='javascript:void(0);' onclick='showtalkenchother()'>私聊中心</a>(<span id='privatecount'></span>条)</div>");
			/*--------------------------------THE ORDER,SHARE,COMMENT CONTENT ------------------------*/
			$("#friend_content_right").append("<div id='osc_all_content'></div>");
			$("#friend_content_right").append("<div id='privatetalkcentre' style='display:block;'></div>");
			$("#osc_all_content").append("<div id='osc'></div><div class='holder2'></div>");//THIS DIV INCLUDE THREE CONTENT 
			
			//TURN TO ACTION AND READ THE CONTENTS OF ORDER AND SHARE AND COMMENT
			
				$.getJSON('MyFriendsTrendsActionByAJAX?time='+Math.random(10),function(data){
					var the_oscCount=data.list.length+data.listShare.length+data.commentcust.length;
					$("#osccount").html(the_oscCount);
					var privateCount=data.fromNames.length;
					$("#privatecount").html(privateCount);
					$.each(data.list,function(index,value){
							var face=value.userFace;
							var friendName=value.userName;
							var time=value.orderTime;
							var customPic=value.customPic;
							$("#osc").append("<div class='myfriend-friendactivity_child'>"+
							"<div class='myfriend-friendactivity_child_userimg'>"+
							"<a href=''><img src='img/"+face+"'/></a></div>"+
							"<div class='myfriend-friendactivity_child_username'>"+
							"<a href='getFriendOwnMessageAction?uname="+friendName+"'>"+friendName+"</a></div>"+
							"<div class='myfriend-friendactivity_child_stylecando'>"+
							"<a href='#'>定制</a></div>"+
							"<div class='myfriend-friendactivity_child_production_img'>"+
							"<a href=''><img src='"+customPic+"'/></a></div>"+
							"<div class='myfriend-friendactivity_child_time'>"+
							time+"</div>"+"</div>");
					});
					$.each(data.listShare,function(index,value){
						var face=value.userFace;
						var friendName=value.userName;
						var time=value.orderTime;
						var customPic=value.customPic;
						$("#osc").append("<div class='myfriend-friendactivity_child'>"+
						"<div class='myfriend-friendactivity_child_userimg'>"+
						"<a href=''><img src='img/"+face+"'/></a></div>"+
						"<div class='myfriend-friendactivity_child_username'>"+
						"<a href='getFriendOwnMessageAction?uname="+friendName+"'>"+friendName+"</a></div>"+
						"<div class='myfriend-friendactivity_child_stylecando'>"+
						"<a href='#'>分享</a></div>"+
						"<div class='myfriend-friendactivity_child_production_img'>"+
						"<a href=''><img src='"+customPic+"'/></a></div>"+
						"<div class='myfriend-friendactivity_child_time'>"+
						time+"</div>"+"</div>");
				});
					$.each(data.commentcust,function(index,value){
						var face=value.userFace;
						var friendName=value.userName;
						var customPic=value.customPic;
						var time=value.commentTime;
						$("#osc").append("<div class='myfriend-friendactivity_child'>"+
						"<div class='myfriend-friendactivity_child_userimg'>"+
						"<a href=''><img src='"+face+"'/></a></div>"+
						"<div class='myfriend-friendactivity_child_username'>"+
						"<a href='getFriendOwnMessageAction?uname="+friendName+"'>"+friendName+"</a></div>"+
						"<div class='myfriend-friendactivity_child_stylecando'>"+
						"<a href='#'>评论</a></div>"+
						"<div class='myfriend-friendactivity_child_production_img'>"+
						"<a href=''><img src='"+customPic+"'/></a></div>"+
						"<div class='myfriend-friendactivity_child_time'>"+
						time+"</div>"+"</div>");
				});
					DoJpages();
					//GET TNE ORDER SHARE  COMMENT ALL COUNT
					
					$("#privatetalkcentre").append("<div id='privatetalkdialog'></div>");
					$("#privatetalkcentre").append("<div id='message'></div>");
					$("#privatetalkcentre").append("<div id='alleachtalk'></div><div class='holder4'></div>");
					$.each(data.fromNames,function(index1,value1){
						var talkcount=0;
						$("#alleachtalk").append("<div id='"+value1+"'</div>");
						$("#"+value1).append("<div id='"+value1+"each_private_content_top'></div>");
						$("#"+value1).append("<div id='"+value1+"each_private_content_center' style='display:none;'></div>");
						$("#"+value1).append("<div id='"+value1+"each_private_content_down'></div><br/>");
						$.each(data.messages,function(index2,value2){
							if(value1==value2.fromName){
								talkcount++;
								if(value2.messageContent.length>10){
									//<span style='size: 2px; cursor: pointer;' onclick='showAllprivatetalk(\""+value2.messageId+"\")' >▼</span>
									$("#"+value1+"each_private_content_top").html("<span style='float:left;'><font color='#99ccff'>"+value2.fromName+":</font></span><span style='float:center;'>"+value2.messageContent.substring(0,10)+"...</span><span style='float:right;'>"+value2.messageTime+"</span><br/>");
									$("#"+value1+"each_private_content_center").append("<span style='float:left;'><font color='#99ccff'>"+value2.fromName+":</font></span><span style='float:center;'>"+value2.messageContent.substring(0,10)+"...<span style='size: 2px; cursor: pointer;' onclick='showAllprivatetalk(\""+value2.messageId+"\")' >▼</span></span><span style='float:right;'>"+value2.messageTime+"</span><br/>");
									$("#"+value1+"each_private_content_center").append("<span style='float:center;display:none;' id='"+value2.messageId+"'>"+value2.messageContent.substring(10,value2.messageContent.length)+"<span onclick='hideAllprivatetalk(\""+value2.messageId+"\")' style='cursor: pointer;'>▲</span></span><br/>");
								}else{
									$("#"+value1+"each_private_content_top").html("<span style='float:left;'><font color='#99ccff'>"+value2.fromName+":</font></span><span style='float:center;'>"+value2.messageContent+"</span><span style='float:right;'>"+value2.messageTime+"</span><br/>");
									$("#"+value1+"each_private_content_center").append("<span style='float:left;'><font color='#99ccff'>"+value2.fromName+":</font></span><span style='float:center;'>"+value2.messageContent+"</span><span style='float:right;'>"+value2.messageTime+"</span><br/>");
								}
							}
						});
						$("#"+value1+"each_private_content_center").append("<span onclick='hideAllprivatetalk(\""+value1+"each_private_content_center\")' style='cursor: pointer;'>▲</span>");
						$("#"+value1+"each_private_content_down").html("<span style='float:right'><a  href='javascript:void(0);' onclick='slidedown(\""+value1+"each_private_content_center\")'>共"+talkcount+"条私聊</a>|<a href='javascript:void(0);' onclick='openDialog2(\""+value1+"\")'>继续聊</a></span><br/>");
						
					});
					if(data.messages.length==0){
						$("#alleachtalk").html("亲，暂时没有数据哦");
					}else{
						DoPrivateJpages();
					}
					
					$("#privatetalkcentre").fadeOut(0);
				});
			}
		
		 function myShareAll(){
			 $("#friend_content_right").html("");
			 document.getElementById("moneyall").className="myfriend_friendactivity_content_right_select_mymoney";
			 $("#moneyall").addClass('myfriend_friendactivity_content_right_select_mymoney');
			 $("#friendall").addClass('myfriend_friendactivity_content_right_select_myfriend2');
			 $("#allofmyshareid").addClass('myfriend_friendactivity_content_right_select_myshare2');
			 $("#friend_content_right").append("<div id='reportdialog'></div>");
			 $("#friend_content_right").append("<div id='privatedialog'></div>");
			 $("#friend_content_right").append("<div id='successdialog'></div>");
			 $("#friend_content_right").append("<div id='customUploadFiledialog'></div>");
			 $("#friend_content_right").append("<div class='myfriend_friendactivity_content_right_childtitle'></div>");
			 $(".myfriend_friendactivity_content_right_childtitle").append("<div class='myfriend_friendactivity_content_right_childtitle_left'></div>");
			 $(".myfriend_friendactivity_content_right_childtitle_left").append("<div style='width:153px; height:23px; float:left; padding-top:3px; text-align:left;'><a href='javascript:void(0);' onclick='showMyshare()'>个人分享</a>(<span id='myShare_count'></span>条)</div>");
			 $(".myfriend_friendactivity_content_right_childtitle").append("<div class='myfriend_friendactivity_content_right_childtitle_right'></div>");
			 $(".myfriend_friendactivity_content_right_childtitle_right").append("<div style='width:153px; height:23px; padding-top:3px;'><a href='javascript:void(0);' onclick='showmyparticipation()'>参与分享</a>(<span id='partinshare_count'></span>个)</div>");
			 $("#friend_content_right").append("<div id='all_share_content_myshare_out'></div>");
			 $("#all_share_content_myshare_out").append("<div id='all_share_content_myshare'></div><div class='holder3'></div>"); 
			 $("#friend_content_right").append("<div id='all_share_content_myparticipation_out'></div>");
			 $("#all_share_content_myparticipation_out").append("<div id='all_share_content_myparticipation'></div><div class='holder'></div>");
			
			 var mysharecommentcount=0;
			 var partinsharecommentcount=0;
			 
			  /*------------------------myshare-------------------------*/
			 $.getJSON('MyOwnShareAndPareInShareAction?time='+Math.random(10),function(data){
				 $("#myShare_count").html(data.mycustomsShare.length);
				 $.each(data.mycustomsShare,function(index1,value1){
					 mysharecommentcount=0;
					 $("#all_share_content_myshare").append("<div id='"+value1.customId+"each_share_content_myshare' class='share_content_left_child' style='border-radius:10px 10px 10px 10px;'></div>");
					 $("#"+value1.customId+"each_share_content_myshare").append("<div id='"+value1.customId+"each_share_content_myshare_left' class='share_content_left_child_img' style='border-radius:10px 10px 10px 10px;'><img src='"+value1.orderPic+"' class='productionimg' style='border-radius:10px 10px 10px 10px;'/></div>");
					 $("#"+value1.customId+"each_share_content_myshare").append("<div id='"+value1.customId+"each_share_content_myshare_right' class='share_content_left_child_text' style='height: 230px; border-radius:10px 10px 10px 10px;'></div>");
					 $("#"+value1.customId+"each_share_content_myshare_right").append("<span style='float:left;'>【"+value1.userName+"】"+value1.orderContent+"</span><br/><br/>");
					 $("#"+value1.customId+"each_share_content_myshare_right").append("<div id='"+value1.customId+"commentContent'></div>");
					 $("#"+value1.customId+"each_share_content_myshare_right").append("<div id='"+value1.customId+"commentContent_all' style='position:absolute;background-color: #9AC0CD;display:none;z-index:999;'></div>");
					 $.each(data.custIsShareComments,function(index2,value2){
						 if(value1.customId==value2.customId){
							 mysharecommentcount++;
							 $("#"+value1.customId+"commentContent").html("<span style='float:left;'><a href='getFriendOwnMessageAction?uname="+value2.userName+"'>"+value2.userName+"</a>:"+value2.commentContent+"-----"+value2.commentTime+"</span>");
							 $("#"+value1.customId+"commentContent").append("<span style='float:right;'><a href='javascript:void(0);' onclick='open_reportdialog(\""+value2.userName+"\",\""+value2.commentId+"\")'>投诉他</a>|<a href='javascript:void(0);' onclick='open_privatedialog(\""+value2.userName+"\")'>私聊</a></span><br/><br/>");
						 }
					 });
					 $("#"+value1.customId+"each_share_content_myshare_right").append("<span style='float:left; id='"+value1.customId+"othercomment'><a href='javascript:void(0);' onclick='ShowMoreComment("+value1.customId+")'>显示更多评论</a>(<span id='"+value1.customId+"mysharecomemntcount'>"+mysharecommentcount+"</span>)</span><br/>");
					 $("#"+value1.customId+"each_share_content_myshare_right").append("<span style='float:left;'><input type='text' name='textContent' id='"+value1.customId+"textContent' size='40'></span><br/>");
					 $("#"+value1.customId+"each_share_content_myshare_right").append("<span style='float:left;'><button type='button'  onclick='CustomUploadFiledialog("+value1.customId+",\""+value1.userName+"\")'>发送图片或文件</button></span>"); 	
					 $("#"+value1.customId+"each_share_content_myshare_right").append("<span style='float:left;'><button type='button'  onclick='sendComment("+value1.customId+")' >发表</button></span>");
				 });
				 DoMyShareJpages();
				 /* ------------------------partinshare-------------------------*/
					$("#partinshare_count").html(data.myPartIncustomsShare.length);
					 $.each(data.myPartIncustomsShare,function(index1,value1){
						 partinsharecommentcount=0;
						 $("#all_share_content_myparticipation").append("<div id='"+value1.customId+"each_share_content_myparticipation' class='share_content_left_child' style='border-radius:10px 10px 10px 10px;'></div>&nbsp;");
						 $("#"+value1.customId+"each_share_content_myparticipation").append("<div id='"+value1.customId+"each_share_content_myparticipation_left' class='share_content_left_child_img' style='border-radius:10px 10px 10px 10px;'><img class='productionimg' src='"+value1.orderPic+"' style='border-radius:10px 10px 10px 10px;'/></div>");
						 $("#"+value1.customId+"each_share_content_myparticipation").append("<div id='"+value1.customId+"each_share_content_myparticipation_right' class='share_content_left_child_text' style='height: 230px; border-radius:10px 10px 10px 10px;'></div>");
						 $("#"+value1.customId+"each_share_content_myparticipation_right").append("<span style='float:left;'>【"+value1.userName+"】"+value1.orderContent+"</span><br/><br/>");
						 $("#"+value1.customId+"each_share_content_myparticipation_right").append("<div id='"+value1.customId+"commentContentmyparticipation'></div>");
						 $.each(data.custPartInShareComments,function(index2,value2){
							 if(value1.customId==value2.customId){
								 partinsharecommentcount++;
								 $("#"+value1.customId+"commentContentmyparticipation").html("<span style='float:left;'><a href='getFriendOwnMessageAction?uname="+value2.userName+"'>"+value2.userName+"</a>:"+value2.commentContent+"-----"+value2.commentTime+"</span>");
								 $("#"+value1.customId+"commentContentmyparticipation").append("<span style='float:right;'><a href='javascript:void(0);' onclick='open_reportdialog(\""+value2.userName+"\",\""+value2.commentId+"\")'>投诉他</a>|<a href='javascript:void(0);' onclick='open_privatedialog(\""+value2.userName+"\")'>私聊</a></span><br/><br/>");
							 }
						 });
						 $("#"+value1.customId+"each_share_content_myparticipation_right").append("<span style='float:left; id='"+value1.customId+"othercommentmyparticipation'><a href='javascript:void(0);' onclick='ShowMoreComment("+value1.customId+")'>显示更多评论</a>(<span id='"+value1.customId+"partinsharecomemntcount'>"+partinsharecommentcount+"</span>)</span><br/>");
						 $("#"+value1.customId+"each_share_content_myparticipation_right").append("<span style='float:left;'><input type='text' name='textContent' id='"+value1.customId+"textContentmyparticipation' size='40'></span><br/><br/>");
						 $("#"+value1.customId+"each_share_content_myparticipation_right").append("<span style='float:left;'><button type='button' onclick='CustomUploadFiledialog("+value1.customId+",\""+value1.userName+"\")'>上传图片或文件</button></span>");		                                                                                                                                                                         
						 $("#"+value1.customId+"each_share_content_myparticipation_right").append("<span style='float:left;'><button type='button' onclick='sendPartInShareComment(\""+value1.customId+"\")' >发送</button></span>");
					 });
					 DoPartInShareJpages();
					 $("#all_share_content_myparticipation_out").hide();
					 toButton();
			 });
		 }
		function showmyshareothercomment(customId){
			//alert(customId);
			$("#"+customId+"commentContent_all").show(500,function(){
				$("#"+customId+"commentContent_all").click(function(){
					$("#"+customId+"commentContent_all").hide();
				});
			});
		}
		function showpartinshareothercomment(customId){
			//alert(customId);
			$("#"+customId+"commentContentmyparticipation_all").show(500,function(){
				$("#"+customId+"commentContentmyparticipation_all").click(function(){
					$("#"+customId+"commentContentmyparticipation_all").hide();
				});
			});
		}
		 function CustomUploadFiledialog(customId,toName){
			 alert(customId+","+toName);
			 $("#customUploadFiledialog").dialog({
				 resizable:false,
	        	  //show: "slide",
	        	  autoOpen:true,
	              module : true,
	              width:600,
	              height:250,
	              position:[getLeft(600),getTop(250)],//定位
	              title: "给他发个文件看",
	              open:function(){
	            		  $("#customUploadFiledialog").html(customuploadfilestr).fadeIn();
	            		  initSWFUpload4(customId,toName);
	              },
	              close: function(event, ui){
	            	  
	              },
	              buttons:{
	            	  '提交' :function(){
	            		  if(upload4.getStats().files_queued === 0){
	            			  alert("无任何文件，您先选择文件");
	            		  }else{
	            			  sendswf4();
	            		      alert("发送成功");
	            		      $(this).dialog('close');
	            		  }
	            	  },
	            	  '取消':function(){
	            		  $(this).dialog('close');
	            	  }
	              },
			 });
		 }
		 function showMyshare(){
			 $("#all_share_content_myshare_out").show();
			 $("#all_share_content_myparticipation_out").hide();
		 }
		 function showmyparticipation(){
			 $("#all_share_content_myshare_out").hide();
			 $("#all_share_content_myparticipation_out").show();
		 }
		 function sendComment(customId){
			 
			 var content=$("#"+customId+"textContent").val();
			 if(content==null||content==""){
				 $("#successdialog").html("亲，请输入内容哦！").dialog({
						autoOpen:true,
						width:300,
						height:180,
						position:[getLeft(300),getTop(180)],
						buttons:{
							确定:function(){
								$(this).dialog("close");
							}
						}
					});
			 }else{
				 $.post('CommentFriendCustomsByAjAxAction?time='+Math.random(10),{'customid':customId,'textContent':content},function(data){
					 	if(data=="success"){
					 		$("#"+customId+"textContent").val("");
					 		$.getJSON('GetTheLastCommentByCustomId?time='+Math.random(),{'CustomId':customId},function(data){
					 			$("#"+customId+"commentContent").html("");
					 			$("#"+customId+"commentContent").append("<span style='float:left;'><a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+"---"+data.comment.commentTime+"</span>");
					 			$("#"+customId+"commentContent").append("<span style='float: right'><a href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>投诉他</a>|<a href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a></span><br/><br/>");
					 			$("#"+customId+"mysharecomemntcount").html(data.commentCountbycustomid);
					 			$("#"+customId+"commentContent_all").append("<span style='float:left;'><a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+"---"+data.comment.commentTime+"</span>");
					 			$("#"+customId+"commentContent_all").append("<span style='float: right'><a href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>举报他</a>|<a href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a></span><br/><br/>");
					 		});
					 		$("#successdialog").html("插入成功了！").dialog({
								autoOpen:true,
								width:300,
								height:180,
								position:[getLeft(300),getTop(180)],
								buttons:{
									确定:function(){
										$(this).dialog("close");
									}
								}
							});
					 	}else{
					 		$("#"+customId+"textContent").val("");
					 		alert("插入失败");
					 	}
				 });
			 }
			 
		 }
		 	function sendPartInShareComment(customId){
			 var content=$("#"+customId+"textContentmyparticipation").val();
			 if(content==null||content==""){
				 $("#successdialog").html("亲，请输入内容哦").dialog({
						autoOpen:true,
						width:300,
						height:180,
						position:[getLeft(300),getTop(180)],
						buttons:{
							确定:function(){
								$(this).dialog("close");
							}
						}
					});
			 }else{
				 $.post('CommentFriendCustomsByAjAxAction?time='+Math.random(),{'customid':customId,'textContent':content},function(data){
					 	if(data=="success"){
					 		$("#"+customId+"textContentmyparticipation").val("");
					 		$.getJSON('GetTheLastCommentByCustomId?time='+Math.random(),{'CustomId':customId},function(data){
					 			$("#"+customId+"commentContentmyparticipation").html("");
					 			$("#"+customId+"commentContentmyparticipation").append("<span style='float:left;'><a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+"---"+data.comment.commentTime+"</span>");
					 			$("#"+customId+"commentContentmyparticipation").append("<span style='float: right'><a href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>投诉他</a>|<a href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a></span><br/><br/>");
					 			$("#"+customId+"partinsharecomemntcount").html(data.commentCountbycustomid);
					 			$("#"+customId+"commentContentmyparticipation_all").append("<span style='float:left;'><a href='getFriendOwnMessageAction?uname="+data.comment.userName+"'>"+data.comment.userName+"</a>:"+data.comment.commentContent+"---"+data.comment.commentTime+"</span>");
					 			$("#"+customId+"commentContentmyparticipation_all").append("<span style='float: right'><a href='javascript:void(0);' onclick='openReportDialog(\""+data.comment.userName+"\","+data.comment.commentId+")'>投诉他</a>|<a href='javascript:void(0);' onclick='openDialog(\""+data.comment.userName+"\")'>私聊</a></span><br/>");
					 		});
					 		$("#successdialog").html("插入成功了！").dialog({
								autoOpen:true,
								width:300,
								height:180,
								position:[getLeft(300),getTop(180)],
								buttons:{
									确定:function(){
										$(this).dialog("close");
									}
								}
							});
					 	}else{
					 		$("#"+customId+"textContentmyparticipation").val("");
					 		alert("插入失败");
					 	}
				 });
			 }
		 }
		 function open_privatedialog(name){
			 $("#privatedialog").dialog({
				 resizable:false,
	        	  //show: "slide",
	        	  autoOpen:true,
	              module : true,
	              width:600,
	              height:450,
	              position:[getLeft(600),getTop(450)],//定位
	              title: "找他私聊下",
	              open:function(){
	            		  $("#privatedialog").append(privatetalkstr).fadeIn();
	            		  $("#toName").val(name);
	            		  initSWFUpload3();
	              },
	              close: function(event, ui){
	            	  //$("#messagContent").val("");
	            	  $("#privatedialog").html("");
	              },
	              buttons:{
	            	  '提交' :function(){
	            		  content= $("#messagContent").val();
	            		  if(content==null||content==""){
	            			  $("#successdialog").html("亲，您还没写私聊内容！").dialog({
									autoOpen:true,
									width:300,
									height:180,
									position:[getLeft(300),getTop(180)],
									buttons:{
										确定:function(){
											$(this).dialog("close");
										}
									}
								});
	            		  }else{
	            			  if(upload3.getStats().files_queued !== 0){
	            				  alert("not null 333");
		            			  sendswf3();
		            		  }else if(upload3.getStats().files_queued === 0){
		            				//alert("file is null");
		            			  $.post('SwfSuccessToDateBase',{'toName':$("#toName").val(),'filesName':"",'messageContent':$("#messagContent").val()},function(data){
		            					if(data=="true"){
		            						$("#successdialog").html("您的私聊已经发到").dialog({
		            							autoOpen:true,
		            							width:300,
		            							height:180,
		            							position:[getLeft(300),getTop(180)],
		            							buttons:{
		            								确定:function(){
		            									$(this).dialog("close");
		            									$("#privatedialog").dialog("close");
		            								}
		            							}
		            						});
		            					}else{
		            							alert("发送失败");
		            							$("#privatedialog").dialog("close");
		            					}
		            				});
		            			
		            		  }
	            		  }
	            	  },
	            	  '取消':function(){
	            		  $(this).dialog('close');
	            	  }
	              },
			 });
		 }
		 function open_reportdialog(name,commentId){
			 	$("#reportdialog").dialog({
			 		  resizable:false,
		        	  //show: "slide",
		        	  autoOpen:true,
		              module : true,
		              width:600,
		              height:450,
		              position:[getLeft(600),getTop(450)],//定位
		              title: "我要投诉他",
		              open:function(){
		            	  	$("#reportdialog").append(reportstr).fadeIn();
		            	  	$("#beReportName").val(name);
		              },
		              close: function(event, ui){
		            	  	$("#reportdialog").html("");
		            	  	//$("#reportContent").html("");
		              },
		              buttons:{
		            	  '提交' :function(){
		            		  var Content=document.getElementById("reportContent").value;
						    	if(Content==null||Content==""){
						    		$("#successdialog").html("亲，您还没有输入举报的理由呢！").dialog({
										autoOpen:true,
										width:300,
										height:180,
										position:[getLeft(300),getTop(180)],
										buttons:{
											确定:function(){
												$(this).dialog("close");
											}
										}
									});
						    	}else{
						    		$.post('SendReportByAjAxAction',{'beReportName':name,'commentId':commentId,'reprotContent':Content},function(data){//传入的值和返回来的值
										if(data =="true"){
											$("#successdialog").html("举报成功！我们会尽快处理").dialog({
												autoOpen:true,
												width:300,
												height:180,
												position:[getLeft(300),getTop(180)],
												buttons:{
													确定:function(){
														$(this).dialog("close");
													}
												}
											});
											$("#reportdialog").dialog('close');
											//return data;
										}else if(data=="false"){
											alert("举报失败");
											$("#reportdialog").dialog('close');
										}
							    	});
						    	}
		            	  },
		            	  '取消':function(){
		            		  $(this).dialog('close');
		            	  }
		              },
			 		
			 	});
		 }
		 
		function  showtalkenchother(){ 
			$("#osc_all_content").hide();
			$("#privatetalkcentre").show();
		}
		function  showfriendschange(){
			$("#moneyall").addClass('myfriend_friendactivity_content_right_select_mymoney');
			$("#friendall").addClass('myfriend_friendactivity_content_right_select_myfriend');
			$("#osc_all_content").show();
			//$("#alleachtalk").html("");
			$("#privatetalkcentre").hide();
		} 
		
		
		
		function share(){
			document.getElementById("shareall").style.display="";
			document.getElementById("costall").style.display="none";
			$("#sharefont").css("color","red");
			$("#costfont").css("color","");
		}
		function cost(){
			document.getElementById("costall").style.display="";
			document.getElementById("shareall").style.display="none";
			$("#costfont").css("color","red");
			$("#sharefont").css("color","");
			
			
		}
		
		
